/*
 * @Author: 赵天天
 * @Date: 2019-04-10 10:00:47
 * @LastEditors: 赵天天
 * @LastEditTime: 2019-05-20 15:07:06
 * @email: dayday_1996@163.com
 * @Descripttion: 系统综合评分中的系统分布个数
 */
export default function Webcount (Xdata, totaldata, data) {
  var webcount = {
    tooltip: {
      borderRadius: 4,
      trigger: 'axis',
      axisPointer: { // 坐标轴指示器，坐标轴触发有效
        type: 'line' // 默认为直线，可选为：'line' | 'shadow'
      },
      textStyle: {
        color: '#ffffff',
        fontSize: 12,
        fontFamily: '宋体'
      },
      formatter: function (params) {
        var tar = params[1]
        let colorcircle = ['#38a0f4', '#ff3333', '#ff6633', '#ff9933', '#ffc833', '#02bc77']
        let index = params[1].dataIndex
        return tar.name + '<br/><svg width="20px" height="20px" version="1.1"><circle cx="10" cy="15" r="4" stroke="' + colorcircle[index] + '" stroke-width="2" fill="' + colorcircle[index] + '"/></svg>' +
                tar.seriesName + ' : ' + tar.value
      }
    },
    grid: {
      left: '0%',
      right: '20px',
      bottom: '19px',
      containLabel: true
    },
    xAxis: {
      type: 'category',
      splitLine: { show: false },
      data: Xdata,
      axisLine: {
        lineStyle: {
          color: '#eeeeee',
          width: 1 // 这里是为了突出显示加上的
        }
      },
      axisLabel: {
        color: '#5c6781',
        fontFamily: '宋体'
      }
    },
    yAxis: {
      type: 'value',
      splitLine: { show: false },
      axisLine: {
        lineStyle: {
          color: '#eeeeee',
          width: 1 // 这里是为了突出显示加上的
        }
      },
      axisLabel: {
        color: '#5c6781',
        fontFamily: '宋体'
      }
    },
    color: function (params) {
      var colorList = ['#38a0f4', '#ff3333', '#ff6633', '#ff9933', '#ffc833', '#02bc77']
      return colorList[params.dataIndex]
    },
    series: [
      {
        name: '辅助',
        type: 'bar',
        stack: '总量',
        itemStyle: {
          normal: {
            color: 'rgba(0,0,0,0)'
          },
          emphasis: {
            color: 'rgba(0,0,0,0)'
          }
        },
        data: totaldata
      },
      {
        name: '系统个数',
        type: 'bar',
        stack: '总量',
        barWidth: 30,
        label: {
          normal: {
            show: false,
            position: 'inside'
          }
        },
        data: data
      }
    ]
  }
  return webcount
}
